/**
 * @file src/ScoringMatrix.h
 *
 * @date 28-aug-2013
 *
 * @author Youri Hoogstrate
 *
 * @section LICENSE
 * yh-kt-fold can predict RNA 2D structures including K-turns.
 * Copyright (C) 2012-2013 Youri Hoogstrate
 *
 * This file is part of yh-kt-fold.
 *
 * yh-kt-fold is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * yh-kt-fold is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */



#define GIBBS_ENERGY_INIT 0



/**
 * @todo work with templates;
 * - Float for Energy values (V & W matrix)
 * - Int for identifiers (Motif objects)
 *
 * @section DESCRIPTION
 * For a matrix of n*n, all values (x,x) for 0 < x < n are initialized with a: 0
 * Similarly, all values (x,x-1) for 1 < x < n are initialized with a: 0
 *
 * Thus, only the positions in the matrix where x > y have to be located.
 * For a matrix of size: 4 * 4 (i = initation, s = store):

[0,0][1,0][2,0][3,0]   [ i ][ s ][ s ][ s ]
[0,1][1,1][2,1][3,1]   [ i ][ i ][ s ][ s ]
[0,2][1,2][2,2][3,2]   [   ][ i ][ i ][ s ]
[0,3][1,3][2,3][3,3]   [   ][   ][ i ][ i ]

size = ((n-1)/2) * n

[ i ][ s ][ s ][ s ][ s ]
[ i ][ i ][ s ][ s ][ s ]
[   ][ i ][ i ][ s ][ s ]
[   ][   ][ i ][ i ][ s ]
[   ][   ][   ][ i ][ i ]

 */



#include "main.h"



/**
 * @brief
 *
 * @date 25-jul-2013
 */
class ScoringMatrix
{
	private:
		int length;
		std::vector<float> m;
		
		int get_position(int x, int y);
		
	public:
		ScoringMatrix(unsigned int length);
		float get(int x, int y);
		void set(int x, int y, float value);
};
